package com.jz.work.controller;

import com.jz.work.service.UserService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("userController")
public class UserController {
    @Resource(name = "userService")
    private UserService userService;

    @RequestMapping(value = "/getUserInfo.do")
    public void getUserInfo() {
        List<Map<String, Object>> user1 = userService.selectUserOneInfo();
        List<Map<String, Object>> user2 = userService.selectUserTwoInfo();
        for (int i = 0; i < user1.size(); i ++) {
            System.out.println(user1.get(i).get("uid"));
            System.out.println(user1.get(i).get("age"));
            System.out.println(user1.get(i).get("name"));
        }
        for (int i = 0; i < user2.size(); i ++) {
            System.out.println(user2.get(i).get("uid"));
            System.out.println(user2.get(i).get("age"));
            System.out.println(user2.get(i).get("name"));
        }
    }
}
